#ifndef SUDOKUSOLVER_H
#define SUDOKUSOLVER_H

#include <QObject>

#include "SudokuAbstractSolvingTechnique.h"
#include "SudokuData.h"

class SudokuSolver : public QObject
{
    Q_OBJECT

public:
    SudokuSolver(QObject* parent = 0);
    virtual ~SudokuSolver();

    void solve(SudokuData* sudokuData, int solveMask = MaskAll, bool resetResults = true);

    inline QMap<CellFillerTypes, SudokuAbstractSolvingTechnique*> getMap() const { return mTechniqueMap; }
    inline SudokuAbstractSolvingTechnique* getTechnique(CellFillerTypes method) const { return mTechniqueMap.value(method, 0); }
    inline int getTechniqueSolveCount(CellFillerTypes method) const { return mTechniqueCountMap.value(method, 0); }

public slots:

private:
    Q_DISABLE_COPY(SudokuSolver)
    /**
      * Map of solving techniques
      */
    QMap<CellFillerTypes, SudokuAbstractSolvingTechnique*> mTechniqueMap;

    /**
      * Map with solve results
      */
    QHash<CellFillerTypes, int> mTechniqueCountMap;

    void addTechnique(SudokuAbstractSolvingTechnique* technique);
};

#endif // SUDOKUSOLVER_H
